package com.ep.springtest;

import javax.annotation.Resource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.ep.demo.entity.Book;
import com.ep.demo.service.IBookService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath*:applicationContext.xml"})
public class TestBook {
	@Resource(name="bookService")
	private IBookService bookService;
	@Test
	public void saveBook(){
		Book book=new Book();
		book.setId("5d55d5d");
		book.setName("444444");
		bookService.saveBook(book);
	}
	public IBookService getBookService() {
		return bookService;
	}
	public void setBookService(IBookService bookService) {
		this.bookService = bookService;
	}
}	
